AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include('shared.lua')

local function Leech(ply, hitgroup, dmginfo)
	local attacker = dmginfo:GetAttacker()
	if attacker:GetNWBool("Leechd") && (dmginfo:IsBulletDamage() || dmginfo:IsExplosionDamage()) && ply != attacker then
		attacker:SetHealth(attacker:Health() + (dmginfo:GetDamage() * 0.46875))
		if attacker:Health() > attacker:GetMaxHealth() then
			attacker:SetHealth(attacker:GetMaxHealth())
		end
	end
end
hook.Add("ScalePlayerDamage", "Leech", Leech)